#任一个英文的纯文本文件，统计其中的单词出现的个数。
# -*- coding: utf-8 -*-
def frequency(filename):
    list_words = []
    with open(filename, "r",encoding="utf-8") as lines:
         file = lines.read().replace(".", " ").replace(","," ").split()
         for i in set(file):
             print("{} 在文中出现 {} 次".format(i,file.count(i),))



frequency("installlinux")


# 只考虑了.号和,号，其他的? ! /这些标点符号呢？